Bitwise operators let you examine and manipulate individual bits within a value. These operators must only be applied to integers, not floating point numbers.
Symbol |
Operator |
Example |
& |
AND |
tag1 & 07 |
| |
inclusive OR |
tag2 | tag1 |
^ |
exclusive OR (XOR) |
tag1 ^ 01 |
>> |
right shift |
tag1 >> 1 |
<< |
left shift |
tag1 << 2 |
~ |
complement |
~ tag1 |
Tip: |
|